package com.campus.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.campus.commons.entity.Semester;
import com.campus.app.mapper.SemesterMapper;
import com.campus.app.service.SemestersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学期表 服务实现类
 * </p>
 *
 * @author Rin
 * @since 2020-12-24
 */
@Service
public class SemesterServiceImpl extends ServiceImpl<SemesterMapper, Semester> implements SemestersService {
    @Autowired
    private SemesterMapper mapper;
    @Override
    public int getSemesterid(String name) {
        QueryWrapper<Semester> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("semesterName", name);

        return mapper.selectOne(queryWrapper).getId();
    }
}
